package Listener.lab3;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

/**
 * @Description:
 * @Author:AMark
 * @Date: 10/30/2023
 */
public class MyActionListener implements ActionListener {
    ButtonDemo_other Bo;
    //!!!!!构造函数没有返回值！！！！！
    public MyActionListener(ButtonDemo_other Bo) {
        this.Bo = Bo;
    }
    @Override
    public void actionPerformed(ActionEvent e) {
        if(e.getSource() == Bo.buttoncancel) {
            Bo.Buttonframe.setTitle("你单击了取消按钮");
        } else if(e.getSource() == Bo.buttonok) {
            Bo.Buttonframe.setTitle("你单击了确认按钮");
        }
    }
}
